<?php
include 'common/autoload.php';
include 'common/header.html';
 include 'common/prodField.php';
//include 'common/prodField_yd.php';
include 'common/Prod_Common.php';
//    include 'common/left.html';
use \pft\Prod\Product;
$obj = new Product($GLOBALS['le']);
$sid = abs($_GET['sid']);//景区ID
//    $apply_did = $_SESSION['memberID'];
$apply_did = $_SESSION['dtype']==6 ? $_SESSION['sid'] : $_SESSION['memberID'];
if($_SESSION['dtype']!=9){
    if($_SESSION['dtype']==6) {
        if(\pft\Member\MemberAccount::GetMemType($_SESSION['sid'])!=0) {
            exit('您的上级不是供应商身份，无法发布产品。');
        }
    }
    elseif($_SESSION['dtype']!=0) {
        exit('您不是供应商身份，无法发布产品。');
    }
    $sel_apply_did = "select apply_did from uu_land where id=$sid limit 1";
    $le->query($sel_apply_did);
    $row = $le->fetch_assoc();
    if($row['apply_did']!=$apply_did )
        exit('<script>alert("这不是你的产品")</script>');
}      
$scenryData = $obj->GetSceneryTitle($sid);
$ptype = $scenryData['p_type'];
//echo $ptype;
$notify_num = $scenryData['fax'];
if($ptype=='B' && !$prod_id) {
    $startplace = substr($scenryData['runtime'],0,strpos($scenryData['runtime'],'|'));
    $endplace = substr($scenryData['runtime'],strpos($scenryData['runtime'],'|')+1);
}
$ticket_arr = array(
    '成人票','儿童票','老人票','军人票','教师票','优惠票'
);
if ($_SESSION['memberID']==94) {
//    print_r($FieldList);
}
if($ptype=='H'){
	include '/var/www/html/new/d/module/common/Db.class.php';
	$dbConf = include '/var/www/html/new/d/module/common/db.conf.php';// 远端服务器配置信息
	\PFT\Db::Conf($dbConf['remote_1']);
	$sql = "select id,zone_name from pft_roundzone where venue_id={$scenryData['venus_id']}";
	$venue_areas = \PFT\Db::fetchAll($sql);
}
$mpath = array(
	'H' => 'http://10.160.4.140/new/d/api/Product_check_h.php',
);
$mdetails = array(
	'H' => 1,
);

?>
<script type="text/javascript">document.title="票类添加 - <?=$GLOBALS['web_title']?>";</script>
<link rel="stylesheet" href="css/aliceui.min.css"/>
<link rel="stylesheet" href="css/resetui.css"/>
<link rel="stylesheet" href="css/product_publish.css?body=1"/>
<link rel="stylesheet" href="css/c_common.css"/>
<link rel="stylesheet" href="css/easydialog.css"/>
<link rel="stylesheet" href="css/prod_store.css"/>
<?include('common/left.html');?>
<div class="wrapper">
<ol class="ui-ministep step3">
    <li class="ui-ministep-item">
        <span class="ui-ministep-text">产品类型</span>
    </li>
    <li class="ui-ministep-item">
        <span class="ui-ministep-text"><?=$FieldList[$ptype]['ticket']['t4']?></span>
    </li>
    <li class="ui-ministep-item ui-ministep-active">
        <span class="ui-ministep-text"><?=$FieldList[$ptype]['ticket']['t1']?></span>
    </li>
</ol>
<form id="post_frm">
    <input type="hidden" name="ptype" value="<?=$ptype?>"/>
    <input type="hidden" name="lastid" value="<?=$sid?>"/>
    <input type="hidden" name="apply_did" value="<?=$apply_did?>"/>
    <input type="hidden" name="startplace" value="<?=$startplace?>"/>
    <input type="hidden" name="endplace" value="<?=$endplace?>"/>
    <input type="hidden" name="ser_date" value="<?=date('Ymd')?>"/>
	<?if(isset($mpath[$ptype])):?>
	<input type="hidden" name="mpath" value="<?=$mpath[$ptype]?>" />
	<input type="hidden" name="mdetails" value="<?=$mdetails[$ptype]?>" />
	<?endif;?>
    <?=$saveByAdminInput?>
    <?
    if($ptype=='F') {
        // exit;
        $package_data = $scenryData['attribute'];
        $package_data = $obj->PackageDataFormat($package_data);
        include TPLPATH .'_package_box.html';
    }
    ?>
    <table class="prod_laun" id="tb_pub">
        <caption>
            <h3>产品名：<?=$scenryData['title'];?></h3>
        </caption>
        <thead>
            <tr class="header">
                <th colspan="2" class="th_n">常用属性<span class="header_explain">（带“<span class="ui-form-required">*</span>”为必填项）</span></th>
                <td class="controlTD td_help">
                    <a href="/d/images/product_publish_help1.jpg" target="_blank" class="icon_16 icon_help"></a>
                </td>
            </tr>
        </thead>
        <tbody class="fixed_th_width">
            <tr>
                <th>付款方式</th>
                <td colspan="2">
                <label><input type="radio" checked="checked" value="1" name="payType"/>在线支付</label>
				<?if($ptype=='H'):?>
				<input type="text" class="input-text w40 chknum" name="cancel_time" value="20" readonly="readonly">分钟未支付自动取消&nbsp;&nbsp;
				<?else:?>
                <input type="text" class="input-text w40 chknum" name="cancel_time" value="120">分钟未支付自动取消&nbsp;&nbsp;
				<label><input type="radio" value="0" name="payType"/>现场支付</label>
				<?endif;?>
				
                </td>
            </tr>
        </td>
            <tr>
                <th id="th_2">使用有效期</th>
                <? $utx = $ptype=='C'? '入住日期':'游玩日期'?>
                <td colspan="2">
                <label><input type="radio" name="validTime" checked="checked" value="0"/><?=$utx?>当天有效</label>&nbsp;&nbsp;
                <?if($ptype=='A' || $ptype=='C' || $data['delaydays']>0){?>
                <input type="radio" id="radio1" name="validTime" value="1"/> 
                    <select id="btn1">
                        <option value="1"> 游玩日期(含)</option>
                        <option value="2"> 下单日期</option>  
                    </select>之后<input class="input-text w40 chknum" id="btn3" type="text" name="vt" value="30">天内有效&nbsp;&nbsp;
                <?}?>
				
				<label><input type="radio" id="radio2" name="validTime" value="3"/>开始日期<input type="text" data-t="bt" id="btn23" data-msg="请选择时间段" name="order_start" class="input-text w66"  onfocus="SelectDate(this,'yyyy-MM-dd',0,0)"/> 至 <input type="text" data-t="bt" id="btn2" data-msg="请选择时间段" value="<?=substr($data['order_end'],0,10)?>"  name="order_end" class="input-text w66" onfocus="SelectDate(this,'yyyy-MM-dd',0,0)" />有效</label>
                </td>
            </tr>
        <tr>
        <td>
    </tr>
<script>
$(document).ready(function(){
  $("#btn1").click(function(){
   document.getElementById('radio1').click();
   $("#radio1").val($(this).val());
  });
});
</script>
            <tr>
                <th>提前预定</th>
                <td colspan="2">
                    需提前<input type="text" class="input-text w40 chknum" name="earyTime" value="0">天，在
                    <select name="f[dhour]">
                        <?for($i=23;$i>=0;$i--):?>
                            <?php $pad_hour = str_pad($i, 2,'0', STR_PAD_LEFT);?>
                            <option value="<?=$pad_hour?>">
                                <?=$pad_hour?>
                            </option>
                        <?endfor;?>
                    </select>
                    <label style="font-weight: bold;font-size: 14px;">:</label>
                    <select name="f[dmin]">
                        <?for($loop_min=59;$loop_min>=0;$loop_min--):?>
                            <?php $pad_min = str_pad($loop_min, 2,'0', STR_PAD_LEFT);?>
                            <option value="<?=$pad_min?>">
                                <?=$pad_min?>
                            </option>
                        <?endfor;?>
                    </select>
                    前预定
                </td>
            </tr>
            <tr>
                <th>产品启用时间</th>
                <td colspan="2">
                    <label><input type="radio" checked="checked" value="1" name="saleTime"/>立刻</label>
                    <label><input type="radio" value="2" name="saleTime"/>放入仓库</label>
                </td>
            </tr>
			<?if($ptype=='H'):// 门票属性?>
			<tr>
				<th id="th_6"><span class="ui-form-required">*</span>关联场馆分区</th>
				<td>
					<select name="zone_id" id="zone_id">
						<?foreach($venue_areas as $key=>$rows):?>
							<option value="<?=$rows['id']?>" <?if($rows['id']==$data_f['zone_id']) echo 'selected="selected"'?>><?=$rows['zone_name']?></option>
						<?endforeach;?>
					</select>
				</td>
			</tr>
			<?endif;// 门票属性结束?>
            <?if($ptype=='B'){?>
                <!--线路属性-->
                <tr>
                    <th>
                        <span class="ui-form-required">*</span>游玩天数
                    </th>
                    <td colspan="2" >
                        <input class="input-text w40 chknum required" data-msg="请输入游玩天数" type="text" name="f[rdays]" id="tourDays" value="<?=$data_f['rdays']?>">天
                        <span class="ui-form-explain">请填写大于0的数字</span>
                        <input class="input-text" name="f[beginPlace]" id="beginPlace"  type="hidden" placeholder="出发地" value="<?=$startplace?>">
                        <input class="input-text" name="f[endPlace]" type="hidden" placeholder="目的地" value="<?=$endplace?>">
                    </td>
                </tr>
                <tr>
                    <th>团号</th>
                    <td colspan="2" >
                        <?
                        $prefix = substr($data_f['series_model'],0, strpos($data_f['series_model'],'{'));
                        $endfix = substr($data_f['series_model'],strpos($data_f['series_model'],'}')+2);
                        ?>
                        <input type="text" name="grp_num1" class="grp_num input-text w50" value="<?=$prefix?>"/>
                        +出团日期+出团编号
                        <select name="grp_num2" class="grp_num">
                            <option value="">选择</option>
                            <?for($i=1;$i<=10;$i++){ $code = str_pad($i, 2,'0',STR_PAD_LEFT);?>
                                <option value="<?=$code?>" <?=$endfix==$code?'selected="selected"':''?>><?=$code?></option>
                            <?}?>
                        </select>
                        预览：<span id="prev_grp_num"><?=!empty($data_f['series_model'])?str_replace('{fck_date}', date('Ymd'),$data_f['series_model']):''?></span>
                    </td>
                </tr>
                <tr>
                    <th><span class="ui-form-required">*</span>集合地点</th>
                    <td colspan="2" >
                        <textarea cols="100" rows="4" class="required" data-msg="请填写集合地点" id="ass_station" name="f[ass_station]"><?=$ass?></textarea>
                        <p class="ui-form-explain">填写集合地点、集合时间及导游手机，<span class="red">多个集合地点请用<strong>分号</strong>（;）分隔</span></p>
                    </td>
                </tr>
                <!--线路属性-->
            <?} else {?>
            <tr>
                <th><span class="ui-form-required">*</span>取票信息</th>
                <td colspan="2">
                    <input type="text" value="" id="ticket_val" placeholder="如“取票地址”、“联系电话”" name="TicketInfo" class="required input-text ticketinfo" data-msg="请输入取票信息">
                    <span class="gray">此信息将在游客手机短信上显示</span>
                </td>
            </tr>
            <?}?>
            <tr class="bo_btn">
                <th rowspan="<?=count($FieldList[$ptype]['ticket']['quickTitle'])+1?>"
                    class="rowspan"
                    style="width:80px">
                    <span class="ui-form-required">*</span>
                    <?=$FieldList[$ptype]['ticket']['ticketType']?>
                </th>
                <td class="controlTD" style="width:140px;text-align: right;">
                    <?if($ptype!='F'){?>
                    <a href="javascript:" class="add_ticket_tp icon_16 icon_add">添加<?=$FieldList[$ptype]['ticket']['ticketType']?></a>
                    <?}?>
                </td>
                <td>
                    产品说明
                </td>
            </tr>
            <?foreach($FieldList[$ptype]['ticket']['quickTitle'] as $key=>$ticket_type){?>
                <tr id="tr_tt_<?=$key?>">
                    <td>
                        <input type="checkbox" data-ttype="<?=$key?>" name="ttitle[<?=$key?>]" class="ticket_type" value="<?=$ticket_type[0]?>"/>
                        <input type="text" class="txt_no_input ticket_type_txt" name="a" value="<?=$ticket_type[0]?>" disabled="disabled"/>
                    </td>
                    <td><input type="text" class="input-text ticket-explain" value="<?=$ticket_type[1]?>" name="TicketExplain[<?=$key?>]"/></td>
                </tr>
            <?}?>
        </tbody>
        </table>
        <table class="prod_laun">
            <thead>
                <tr class="header">
                    <th class="th_n">扩展属性</th>
<!--                    <span class="header_explain">（可选项）</span>-->
                    <td class="td_n"><button type="button" class="ext_property ui-button ui-button-sblue">显示</button></td>
                </tr>
            </thead>
            <tbody id="ExtendProperty" class="fixed_th_width">
            <tr>
                <th>销售对象</th>
                <td>
                    <?=GetHtmlSelect($ProvideTo,'provide2');?>
                </td>
            </tr>
            <!-- <tr>
                <th>取消费用</th>
                <td>
                    <input type="text" name="reb" class="input-text w40 chknum" value="<?=$data['reb']?>"/><span class="number_style">%</span>
                    <span>
                    <select name="reb_type">
                    <option value="0">百分比计算</option>
                    <option value="1" <?if($data['reb_type']==1) echo 'selected="selected"'?>>固定金额</option></select>
                    </span>
                    <span class="ui-form-explain">取消订单需要收取的费用百分比</span>
                </td>
            </tr> -->
			<tr>
            <th>取消费用</th>
            <td>
				 <span class="number_style"><select id="testtt" onchange="check()" name="reb_type">
                    <option value="0">售价百分比</option>
                    <option value="1" <?if($data['reb_type']==1) echo 'selected="selected"'?>>固定金额</option></select>
                </span>
                <input type="text" name="reb" class="input-text w40 chknum" value="<?=($data['reb_type'])?  $data['reb']/100:$data['reb']?>"/>
                <span id="num_style">%</span>
                <span id="yuan_style">元</span>
               
                <span class="ui-form-explain">取消订单需要收取的费用百分比，填“0”代表不收取费用。</span>
            </td>
        </tr>
            <?php if($ptype=='A'):?>
                <tr>
                    <th>验证时间</th>
                    <td colspan="2">
                        <label><input type="radio" checked="checked" value="0" name="v_time_limit"/>不限</label>
                        <label><input type="radio" value="1" name="v_time_limit"/>自定义</label>
                        <span id="span_v_time_limit" style="display: none;">
                            <select id="v_tl_1">
                                <?php for($i=0; $i<=23; $i++):?>
                                    <option value="<?=$i . ':00'?>" <?=($i==8? 'selected':'')?>><?=$i.':00'?></option>
                                <?php endfor;?>
                            </select>至
                            <select id="v_tl_2">
                                <?php for($i=0; $i<=23; $i++):?>
                                    <option value="<?=$i . ':00'?>" <?=($i==18? 'selected':'')?>><?=$i.':00'?></option>
                                <?php endfor;?>
                            </select>
                        </span>
                        <span class="ui-form-explain">限制日场票或夜场票的验票时间，间隔必须大于1小时</span>
                    </td>
                </tr>
                <tr>
                    <th>验证限制</th>
                    <td colspan="2">
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="1">日</label>
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="2">一</label>
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="3">二</label>
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="4">三</label>
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="5">四</label>
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="6">五</label>
                        <label><input type="checkbox" checked="checked" name="verify_limit[]" class="pday" value="7">六</label>
                    </td>
                </tr>
            <?php endif;?>
            <tr>
                <th>通知供应商</th>
                <td>
                    <label><input type="radio" name="confirm_sms" checked="checked" value="0" />否</label>
                    <label><input type="radio" name="confirm_sms" value="1" />是</label>
                    <span class="ui-form-explain">新订单是否短信通知供应商</span>
                    通知手机： <input type="text" maxlength="11" id="notify_num"
                                 readonly="readonly" value="<?=$notify_num?>"
                    class="notify_num"/>
                    <a id="edit_notify_num" href="javascript:">编辑</a>
                    <a id="cancel_edit_num" style="display: none;" href="javascript:">取消</a>
                    <span id="edit_res"></span>
                </td>
            </tr>
            <tr>
                <th>发送凭证码</th>
                <td>
                    <label><input type="radio" name="sendVoucher" value="0" checked="checked"/>是</label>
                    <label><input type="radio" name="sendVoucher" value="1" />否</label>
                    <span class="ui-form-explain">是否发送短信（凭证码）到取票人手机</span>
                </td>
            </tr>
            <tr>
                <th>产品介质</th>
                <td colspan="2">
                    <label><input type="radio" checked="checked" value="0" name="ticketMedia"/>电子票</label>
                    <label><input type="radio" value="1" name="ticketMedia"/>实体票（需寄送）</label>
                </td>
            </tr>
            <tr>
                <th>游客信息</th>
                <td>
                    <label><input type="radio" name="tourist_info" checked="checked" value="0"/>无需填写</label>
                    <label><input type="radio" name="tourist_info" value="1"/>只需填写一位游客信息</label>
                    <label><input type="radio" name="tourist_info" value="2"/>需填写所有游客信息</label>
                    <span class="ui-form-explain">游客信息指游客姓名及身份证号</span>
                </td>
            </tr>
            <tr>
                <th>身份证验证</th>
                <td>
                    <label><input type="radio" class="vn_middle" checked="checked" value="0" name="v_ID_support" />不支持</label>
                    <label><input type="radio" onclick="return confirm('您确定终端已经支持身份证验证了吗？')" class="vn_middle" value="1" name="v_ID_support" />支持</label>
                    <span class="ui-form-explain">开启身份证验证需终端支持。</span>
                </td>
            </tr>
<!--            <tr>-->
<!--                <th>手机号码验证</th>-->
<!--                <td>-->
<!--                    <label><input type="radio" name="v_mobile_support" checked="checked" value="0"/>不支持</label>-->
<!--                    <label><input type="radio" name="v_mobile_support" value="1"/>支持</label>-->
<!--                    <span class="ui-form-explain">是否支持使用手机号码验证订单</span>-->
<!--                </td>-->
<!--            </tr>-->
            <tr>
                <th>一次最少</th>
                <td>
                    <input type="text" name="blimit_low" class="input-text w40 chknum" value="<?=isset($data) ? $data['buy_limit_low']:'1'?>"/>
                    <span class="gray">一次最少购买的数量</span>
                </td>
            </tr>
            <tr>
                <th>一次最多</th>
                <td>
                    <input type="text" name="blimit_up" class="input-text w40 chknum " value="<?=isset($data)?$data['buy_limit_up']:'0'?>"/>
                    <span class="gray">一次最多购买的数量，填“0”代表不限</span>
                </td>
            </tr>
             <tr>
                <th>微信通知</th>
                <td>
                    <label><input type="radio" name="confirm_wx" value="0" id='confirm_wx0'  checked="checked"/>否</label>
                <label><input type="radio" name="confirm_wx" value="1" id='confirm_wx' />是</label>
                <span class="ui-form-explain">是否发送订单通知到微信</span>
                <a style='margin-left:10px' />请到手机端关注票付通官方微信
                </td>
            </tr>
            </tbody>
        </table>
        <table class="prod_laun" id="price_tb">
            <thead>
            <tr class="header">
                <th colspan="6" class="th_n">
                    价格/库存配置
                    <span class="header_explain">（选择<?=$FieldList[$ptype]['ticket']['ticketType']?>后添加）</span>
                </th>
                <td class="controlTD td_help" colspan="2">
                    <a href="/d/images/product_publish_help2.jpg" target="_blank" class="icon_16 icon_help"></a>
                </td>
            </tr>
            <tr class="bo_btn price_header">
                <th class="col1"><?=$FieldList[$ptype]['ticket']['ticketType']?></th>
                <th class="col2">适用时间段(同<?=$FieldList[$ptype]['ticket']['ticketType']?>不能重复)</th>
                <th class="col3">适用日期</th>
                <th class="col4 price_helper" title="产品每天的库存，填“-1”表示不限">日库存</th>
                <th class="col4 price_helper" title="各级分销商最低结算价,单位“元”">供货价</th>
                <th class="col5 price_helper" title="产品限制的最低零售价格,单位“元”">零售价</th>
                <th class="col6">门市价</th>
                <th class="col7">操作</th>
            </tr>
            </thead>
            <?foreach($FieldList[$ptype]['ticket']['quickTitle'] as $key=>$ticket_type){?>
                <tbody id="pof_<?=$key?>" class="hide">
                    <tr>
                        <th rowspan="1" id="pof_t_<?=$key?>"><?=$ticket_type[0]?></th>
                        <td class="td_date">
                            从<input type="text" data-t="bt" data-msg="请选择时间段" value="<?=date('Y-m-d')?>" readonly="readonly" name="bt_<?=$key?>" class="required input-text w66" onfocus="SelectDate(this,'yyyy-MM-dd',0,0)"/>
                            至<input type="text" data-t="et" data-msg="请选择时间段" value="<?=date('Y').'-12-31'?>" readonly="readonly" name="et_<?=$key?>" class="required input-text w66" onfocus="SelectDate(this,'yyyy-MM-dd',0,0)"/>
                        </td>
                        <td>
                            <a href="javascript:" class="date_chk" data-chk="1">全选</a>&nbsp;
                            <a href="javascript:" class="date_chk" data-chk="2">平时</a>&nbsp;
                            <a href="javascript:" class="date_chk" data-chk="3">周末</a>
                            <br/>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="0">日</label>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="1">一</label>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="2">二</label>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="3">三</label>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="4">四</label>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="5">五</label>
                            <label><input type="checkbox" checked="checked" name="normalDay_<?=$key?>" class="pday" value="6">六</label>
                        </td>
                        <td>
                            <input type="text" value="不限" class="required input-text w40 storage NumDecText" name="sg_<?=$key?>">
                        </td>
                        <td>
                            <input type="text" data-t="pp" data-msg="请输入供货价" class="required input-text w40 NumDecText" name="pg_<?=$key?>">
                        </td>
                        <td><input type="text" data-t="sp" data-msg="请输入零售价" class="required input-text w40 NumDecText" name="pl_<?=$key?>">
                        </td>
                        <td><input type="text" data-msg="请输入门市价" class="required input-text w40 NumDecText" name="pm_<?=$key?>">
                        </td>
                        <td><a href="javascript:" class="price_add" data-ttype="<?=$key?>">添加</a></td>
                    </tr>
                </tbody>
            <?}?>
        </table>
        <div class="button_wrap">
            <button type="button" id="btn_save" class="ui-button ui-button-lorange">保存</button>
        </div>
    </form>
    </div>
<div id="msg_wrap">
    <div id="result_msg">数据提交中，请稍等</div>
    <p id="confrim_wrap" class="setStyle" style="display: none;">
        <button class="closeWrap ui-button ui-button-sblue">确定</button>
    </p>
</div>
<script type="text/template" id="ticket_temlate">
<tr id="tr_tt_{key}">
    <td>
    <input type="checkbox" data-ttype="{key}" name="ttitle[{key}]" checked="checked" class="ticket_type" value=""/>
    <input type="text" class="txt_no_input ticket_type_txt txt_input" name="a" value="" />
    </td>
    <td><input type="text" class="input-text ticket-explain" value="" name="TicketExplain[{key}]"/></td>
</tr>
</script>
<script type="text/template" id="template">
<tr>
    {ticket_title} 
    <td class="td_date">
        从<input type="text" data-t="bt" data-msg="请选择时间段" name="bt_{key}" readonly="readonly" class="required input-text w66" onfocus="SelectDate(this,'yyyy-MM-dd',0,0)"/>
        至<input type="text" data-t="et" data-msg="请选择时间段" name="et_{key}" readonly="readonly" class="required input-text w66" onfocus="SelectDate(this,'yyyy-MM-dd',0,0)"/>
    </td>
    <td>
        <a href="javascript:" class="date_chk" data-chk="1">全选</a>&nbsp;
        <a href="javascript:" class="date_chk" data-chk="2">平时</a>&nbsp;
        <a href="javascript:" class="date_chk" data-chk="3">周末</a>
        <br/>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="0">日</label>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="1">一</label>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="2">二</label>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="3">三</label>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="4">四</label>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="5">五</label>
        <label><input type="checkbox" name="normalDay_{key}" checked="checked" class="pday" value="6">六</label>
    </td>
    <td>
       <input type="text" data-t="pp" value="不限" class="required input-text w40 storage" name="sg_{key}">
    </td>
    <td><input type="text" data-t="pp" data-msg="请输入供货价"  class="required input-text w40" onkeyup="value=value.replace(/[^\d\.]/g,'')" name="pg_{key}">
    </td>
    <td><input type="text" data-t="sp" data-msg="请输入零售价" class="required input-text w40" onkeyup="value=value.replace(/[^\d\.]/g,'')" name="pl_{key}">
    </td>
    <td>
        {market_price}
    </td>
    <td>{price_control}</td>
</tr>
</script>
<script>
function check()
	 {
	 var r=document.getElementById("testtt").value;
	   if (r=='0'){
	   //alert(11);
	   document.getElementById("num_style").style.color="#000000";
	   document.getElementById("yuan_style").style.color="#ffffff";
	  }
	   else{
	   document.getElementById("yuan_style").style.color="#000000";
	   document.getElementById("num_style").style.color="#ffffff";
	   }
	   
	 }
	 window.onload = function(){
		var rr=document.getElementById("ticket_val").value;
		 if(rr==""){
		   document.getElementById("ticket_val").value="取票信息:"
		   }
	   if (r=='0'){
	   //alert(11);
	   document.getElementById("num_style").style.color="#000000";
	   document.getElementById("yuan_style").style.color="#ffffff";
	  }
	   else{
	   document.getElementById("yuan_style").style.color="#000000";
	   document.getElementById("num_style").style.color="#ffffff";
	   }
			   
	}

  $(".NumDecText").keyup(function(){   
				$(this).val($(this).val().replace(/[^0-9.]/g,''));    
			}).bind("paste",function(){  //CTR+V事件处理    
				$(this).val($(this).val().replace(/[^0-9.]/g,''));     
			})    

</script>
<script src="js/Calendar.js"></script>
<script src="js/jquery.blockUI.js"></script>
<script src="js/product_publish.js?timestamp=150603"></script>
<?include 'common/footer.html';?>